package cn.erperp.cdc.maxwell.entity;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "outbox_message", schema = "ning", catalog = "")
public class BusEventsApiEntity {
    private long id;
    private String mqType;
    private String mqJson;
    private String className;
    private String eventJson;
    private String userToken;
    private Timestamp createdDate;
    private String creatingOwner;
    private String processingOwner;
    private Timestamp processingAvailableDate;
    private String processingState;
    private Integer errorCount;
    private Long searchKey1;
    private Long searchKey2;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "mq_type")
    public String getMqType() {
        return mqType;
    }

    public void setMqType(String mqType) {
        this.mqType = mqType;
    }

    @Basic
    @Column(name = "mq_json")
    public String getMqJson() {
        return mqJson;
    }

    public void setMqJson(String mqJson) {
        this.mqJson = mqJson;
    }

    @Basic
    @Column(name = "class_name")
    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    @Basic
    @Column(name = "event_json")
    public String getEventJson() {
        return eventJson;
    }

    public void setEventJson(String eventJson) {
        this.eventJson = eventJson;
    }

    @Basic
    @Column(name = "user_token")
    public String getUserToken() {
        return userToken;
    }

    public void setUserToken(String userToken) {
        this.userToken = userToken;
    }

    @Basic
    @Column(name = "created_date")
    public Timestamp getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Timestamp createdDate) {
        this.createdDate = createdDate;
    }

    @Basic
    @Column(name = "creating_owner")
    public String getCreatingOwner() {
        return creatingOwner;
    }

    public void setCreatingOwner(String creatingOwner) {
        this.creatingOwner = creatingOwner;
    }

    @Basic
    @Column(name = "processing_owner")
    public String getProcessingOwner() {
        return processingOwner;
    }

    public void setProcessingOwner(String processingOwner) {
        this.processingOwner = processingOwner;
    }

    @Basic
    @Column(name = "processing_available_date")
    public Timestamp getProcessingAvailableDate() {
        return processingAvailableDate;
    }

    public void setProcessingAvailableDate(Timestamp processingAvailableDate) {
        this.processingAvailableDate = processingAvailableDate;
    }

    @Basic
    @Column(name = "processing_state")
    public String getProcessingState() {
        return processingState;
    }

    public void setProcessingState(String processingState) {
        this.processingState = processingState;
    }

    @Basic
    @Column(name = "error_count")
    public Integer getErrorCount() {
        return errorCount;
    }

    public void setErrorCount(Integer errorCount) {
        this.errorCount = errorCount;
    }

    @Basic
    @Column(name = "search_key1")
    public Long getSearchKey1() {
        return searchKey1;
    }

    public void setSearchKey1(Long searchKey1) {
        this.searchKey1 = searchKey1;
    }

    @Basic
    @Column(name = "search_key2")
    public Long getSearchKey2() {
        return searchKey2;
    }

    public void setSearchKey2(Long searchKey2) {
        this.searchKey2 = searchKey2;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BusEventsApiEntity that = (BusEventsApiEntity) o;

        if (id != that.id) return false;
        if (mqType != null ? !mqType.equals(that.mqType) : that.mqType != null) return false;
        if (mqJson != null ? !mqJson.equals(that.mqJson) : that.mqJson != null) return false;
        if (className != null ? !className.equals(that.className) : that.className != null) return false;
        if (eventJson != null ? !eventJson.equals(that.eventJson) : that.eventJson != null) return false;
        if (userToken != null ? !userToken.equals(that.userToken) : that.userToken != null) return false;
        if (createdDate != null ? !createdDate.equals(that.createdDate) : that.createdDate != null) return false;
        if (creatingOwner != null ? !creatingOwner.equals(that.creatingOwner) : that.creatingOwner != null)
            return false;
        if (processingOwner != null ? !processingOwner.equals(that.processingOwner) : that.processingOwner != null)
            return false;
        if (processingAvailableDate != null ? !processingAvailableDate.equals(that.processingAvailableDate) : that.processingAvailableDate != null)
            return false;
        if (processingState != null ? !processingState.equals(that.processingState) : that.processingState != null)
            return false;
        if (errorCount != null ? !errorCount.equals(that.errorCount) : that.errorCount != null) return false;
        if (searchKey1 != null ? !searchKey1.equals(that.searchKey1) : that.searchKey1 != null) return false;
        if (searchKey2 != null ? !searchKey2.equals(that.searchKey2) : that.searchKey2 != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (mqType != null ? mqType.hashCode() : 0);
        result = 31 * result + (mqJson != null ? mqJson.hashCode() : 0);
        result = 31 * result + (className != null ? className.hashCode() : 0);
        result = 31 * result + (eventJson != null ? eventJson.hashCode() : 0);
        result = 31 * result + (userToken != null ? userToken.hashCode() : 0);
        result = 31 * result + (createdDate != null ? createdDate.hashCode() : 0);
        result = 31 * result + (creatingOwner != null ? creatingOwner.hashCode() : 0);
        result = 31 * result + (processingOwner != null ? processingOwner.hashCode() : 0);
        result = 31 * result + (processingAvailableDate != null ? processingAvailableDate.hashCode() : 0);
        result = 31 * result + (processingState != null ? processingState.hashCode() : 0);
        result = 31 * result + (errorCount != null ? errorCount.hashCode() : 0);
        result = 31 * result + (searchKey1 != null ? searchKey1.hashCode() : 0);
        result = 31 * result + (searchKey2 != null ? searchKey2.hashCode() : 0);
        return result;
    }
}
